<script lang="ts">
  import type { ResultValue } from '@mathesar/api/rpc/records';
  import type { Table } from '@mathesar/models/Table';
  import { TableStructure } from '@mathesar/stores/table-data';
  import RecordSummaryConfig from '@mathesar/systems/table-view/table-inspector/record-summary/RecordSummaryConfig.svelte';

  export let linkedTable: Table;
  export let previewRecordId: ResultValue | undefined = undefined;
  export let onSave: (() => void) | undefined = undefined;

  $: structure = new TableStructure(linkedTable);
  $: ({ processedColumns, isLoading } = structure);
</script>

<RecordSummaryConfig
  table={linkedTable}
  processedColumns={$processedColumns}
  isLoading={$isLoading}
  {previewRecordId}
  {onSave}
/>
